<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    let money=1000
    while(true){
      let caozuo=+prompt(`输入
      1取款
      2存款
      3查看余额
      4退出
      的操作`)
      switch (caozuo){
        case 1:
          let qukuan=+prompt('你要取多少钱')
          money=money-qukuan
          break
          case 2:
            let cunkuan=+prompt('你要存多少钱')
            money=money+cunkuan
            break
            case 3:
            alert(`余额为${money}`)
            break
      }    
      if(caozuo===4){
        alert('操作结束')
        break
      }
    }
  </script>
</body>
</html>